/*
 * @Author: yxfan
 * @Date: 2024-06-21 10:59:07
 * @LastEditTime: 2024-10-11 18:20:07
 * @FilePath: /umi-demo/src/pages/demo/Diff2html/newStr.js
 * @Description:
 */
export default `upstream cicd_server {
    server 127.0.0.1:8099;
}
upstream assets_engine {
    server 127.0.0.1:20600;
}
# 占位符请勿修改
server {
    # 端口占位符
    listen __PORT__;
    # gzip config
    gzip on;
    gzip_min_length 2k;
    gzip_comp_level 9;
    gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml;
    gzip_vary on;
    gzip_disable "MSIE [1-6]\.";

    server_tokens   off;

    # root占位符
    root __ROOT__;
    # 文件上传，如果不设置，默认是1M
    client_max_body_size 20M;
    location / {
        add_header Cache-Control 'max-age=0, must-revalidate';
        try_files $uri $uri/ /index.html;
    }

    # 对source map文件进行权限设置
    location ~* ^/assets-engine/.*\.map$ {
        rewrite ^/assets-engine/(.*\.map)$ /$1 break;
        # sourcemap文件的路径
        root /home/streamax/.assets-engine__store;
        # 权限配置 指定ip可获取
        allow 171.88.182.183;  # 允许的 IP 地址
        deny all;              # 拒绝其他所有 IP 地址
    }

    # 不对外暴露20600端口
    location /assets-engine/ {
        proxy_pass http://assets_engine/;
    }
    # 重定向到登陆页
    location ~^/assets-engine/web/cicd-web/dist/?$ {
        return 301 /login;
    }
    location /be/ {
        proxy_pass http://cicd_server/;
        proxy_read_timeout 600s;
    }

    # 运维包下载的链接需要单独处理一下
    location /be/cicd/download/getMaintainPackage {
        proxy_pass http://cicd_server/cicd/download/getMaintainPackage;
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_read_timeout 600s;
    }
    # 中间件包下载链接需要单独处理
    location /be/cicd/middle/componentVersion/download/ {
        proxy_pass http://cicd_server/cicd/middle/componentVersion/download/;
        proxy_buffering off;
        proxy_request_buffering off;
        proxy_read_timeout 600s;
        # 关闭代理缓存
        proxy_cache off;
        chunked_transfer_encoding off;
    }
    location /be/cicd/sse/ {
        proxy_pass http://cicd_server/cicd/sse/;
        proxy_buffering off;
        proxy_read_timeout 601s;
    }
}
`;
